<?php

namespace Narti\BouncerBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Bridge\Doctrine\Validator\Constraints as Unique;

/**
 * Narti\BouncerBundle\Entity\Craft
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="Narti\BouncerBundle\Repository\CraftRepository")
 * @Unique\UniqueEntity(fields={"nome"})
 */
class Craft
{
    public function __construct()
    {
        $this->landlines = new \Doctrine\Common\Collections\ArrayCollection();
        $this->createdAt = new \DateTime();
    }
       
    
    /**
     * @var integer $id
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string $nome
     *
     * @ORM\Column(name="nome", type="string", length=64)
     * @Assert\NotBlank(message="Campo nome obbligatorio")
     * @Assert\MaxLength(limit=40, message="Campo nome massimo 40 caratteri")
     */
    private $nome;

    /**
     * @var text $descrizione
     *
     * @ORM\Column(name="descrizione", type="text")
     * @Assert\NotBlank(message="Campo descrizione obbligatorio")
     * @Assert\MaxLength(limit=80, message="Campo descrizione massimo 80 caratteri")
     */
    private $descrizione;

    /**
     * @var integer $rnd
     *
     * @ORM\Column(name="rnd", type="integer")
     */
    private $rnd;

    /**
     * @var datetime $createdAt
     *
     * @ORM\Column(name="createdAt", type="datetime")
     */
    private $createdAt;

     /**
     * @ORM\OneToMany(targetEntity="Landline", mappedBy="craft")
     */
    private $landlines;

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set nome
     *
     * @param string $nome
     */
    public function setNome($nome)
    {
        $this->nome = $nome;
    }

    /**
     * Get nome
     *
     * @return string 
     */
    public function getNome()
    {
        return $this->nome;
    }

    /**
     * Set descrizione
     *
     * @param text $descrizione
     */
    public function setDescrizione($descrizione)
    {
        $this->descrizione = $descrizione;
    }

    /**
     * Get descrizione
     *
     * @return text 
     */
    public function getDescrizione()
    {
        return $this->descrizione;
    }

    /**
     * Set rnd
     *
     * @param integer $rnd
     */
    public function setRnd($rnd)
    {
        $this->rnd = $rnd;
    }

    /**
     * Get rnd
     *
     * @return integer 
     */
    public function getRnd()
    {
        return $this->rnd;
    }

   
    /**
     * Get createdAt
     *
     * @return datetime 
     */
    public function getCreatedAt()
    {
        return $this->createdAt;
    }
    
     /**
     * Add landlines
     *
     * @param Narti\BouncerBundle\Entity\Landline $landlines
     */
    public function addLandlines(\Narti\BouncerBundle\Entity\Landline $landlines)
    {
        $this->landlines[] = $landlines;
    }

    /**
     * Get landlines
     *
     * @return Doctrine\Common\Collections\Collection 
     */
    public function getLandlines()
    {
        return $this->landlines;
    }
}